﻿

using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TodoApp.Login
{

    /// <summary>
    ///  登录 
    /// </summary>
  
    public class LoginService : Volo.Abp.Application.Services.ApplicationService
    {
        /// <summary>
        /// 注入 
        /// </summary>

        public IConfiguration _configuration;

        public LoginService(IConfiguration configuration)
        {
            _configuration = configuration;
        }

        public async  Task<LoginDTO> GetLoginst( string UseName , string UsePwd ) {

            Ids4Service ids4Service = new Ids4Service(_configuration);

            string token = await ids4Service.GetIdsTokenAsync( UseName,UsePwd );

            return new LoginDTO
            {
                LoginTrue = token != null  ? true : false,
                Token = token
            };
           
        }
       

    }

}
